<div id="info_Ticket" class="largebloc2">
	<h2><?php echo __('ticket')." : ".$ticket['Ticket']['name']; ?></h2>
	<p>
    	<?php echo __('the').$time->nice($ticket['Ticket']['creation_date']); ?><?php echo __('initiated_by').$ticket['User']['firstname'] . ' ' . $ticket['User']['lastname']; ?> <?php echo $allowDelete ? '- ' .  $html->link(__('delete_ticket', true), '/'.$project_name.'/'.$project_id.'/tickets/delete/'.$ticket['Ticket']['id'].'/', NULL, __('are_you_sure', true)) : ''; ?><br />
    </p>
    <?php echo $this->renderElement('tickets/doc'); ?>
	<?php 
		$urlPath = Router::getPaths();
	?>
	<?php if ($authorized) { ?>
	<form action="<?php echo $urlPath['base'] . '/' .$project_name.'/'.$project_id.'/tickets/reopen'; ?>" method="post" accept-charset="utf-8">
		<?php echo $form->input('Ticket.id', array('value' => $ticket['Ticket']['id'])); ?>
		<p><?php __('ticket_closed'); ?> <input type="submit" value="<?php echo __('re_open'); ?>"></p>
	</form>
	<?php } ?>
	<form action="<?php echo $urlPath['base'] . '/' .$project_name.'/'.$project_id.'/tickets/update/'; ?>" method="post" accept-charset="utf-8">
		<?php echo $this->renderElement('tickets/info'); ?>
        <table width="100%" border="0" cellspacing="4" cellpadding="0">
          <tr class="odd3">
            <td width="20%"><?php echo $form->label(__('milestone', true)); ?></td>
            <td><?php echo $form->select('Ticket.milestone_id', $Milestones, $ticket['Ticket']['milestone_id'], array('disabled' => !$allow_crud), false); ?></td>
          </tr>
          <tr class="even3">
            <td><?php echo $form->label(__('state', true)); ?></td>
            <td><?php echo $form->select('Ticket.status', array('to qualify' => 'to qualify','in process' => 'in process','idle' => 'idle','idle client' => 'idle client','closed' => 'closed'), $ticket['Ticket']['status'], array('disabled' => !$allow_crud), false); ?></td>
          </tr>
        </table>
</div><br/>
<div id="replies" class="largebloc1">
	<table width="100%" border="0" cellspacing="0" cellpadding="2">
	<?php echo $html->tableHeaders(array(__('author', true), 'Date', __('summary', true), __('changes', true)), 'class="details"');
	foreach ($ticket['Reply'] as $reply) {
		echo $html->tableCells(array($reply['User']['firstname'] . ' ' .$reply['User']['lastname'],
									$time->nice($reply['date']),
									nl2br($reply['response']),
									$reply['changelog']),
								 'class="odd"', 'class="even"');
	}
	?>
	</table>
</div>
<br />
<div id="reply" class="largebloc2">
	<h2><?php echo __('answers'); ?></h2>
		<?php echo $form->textarea('Reply.response', array('rows'=>'10','cols'=>'50')); ?>
		<?php echo $form->hidden('Reply.ticket_id', array('value' => $ticket['Ticket']['id'])); ?>
		<?php echo $form->hidden('Reply.user_id', array('value' => $user['id'])); ?>
</div>
	<p><?php echo $form->submit(__('save_modifications', true)) ?></p>
</form>